/**
 *  使用handlebars处理数据
 * @param {Object} data 数据
 * @param {String} id handlebars的id
 * @param {Object} jquery元素对象
 */
let _handlebars = (data, id, $elem) => {
    // Handlebars
    let source = $('#' + id).html();
    let template = Handlebars.compile(source);
    let html = template(data);
    $elem.html(html);
};

Handlebars.registerHelper('if_eq', function(v1, v2, opts) {
    if(v1 === v2)
        return opts.fn(this);
    else
        return opts.inverse(this);
});

let setMyModalTitle = (title) => {
    $('#my-modal-title').html(title);
};


let setMyModalBody = (body) => {
    $('#my-modal-body').html(body.html());
};
